{extend name="template/base" /}
{block name="style"}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<!--select2样式 end -->
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">标题：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="标题" name="title" value="{$vo.title ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">佣金：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="佣金" name="settlement_money" value="{$vo.settlement_money ?? ''}" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">结算方式：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="结算方式" name="settlement_mode" value="{$vo.settlement_mode ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">数量：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="数量" name="num" value="{$vo.num ?? ''}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">用车形式：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="car_form" class="select"  id="car_form">
                    <option value="">选择用车形式</option>
                    <option value="拼车" {eq name="vo.car_form" value="拼车"} selected = "selected" {/eq} >拼车</option>
                    <option value="包车"  {eq name="vo.car_form" value="包车"} selected = "selected" {/eq}>包车</option>
                    <option value="定制"  {eq name="vo.car_form" value="定制"} selected = "selected" {/eq}>定制</option>
                    <option value="深度游"  {eq name="vo.car_form" value="深度游"} selected = "selected" {/eq}>深度游</option>
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车型：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="car_type_id" class="select"  id="car_type_id">
                    <option value="">选择车型</option>
                    {volist name="car_types" id="car_type"}
                    <option value="{$car_type['id']}"  >{$car_type['id']}：{$car_type['car_type']}：{$car_type['seating']}{$car_type['seating']<$car_type['max_seating']?"-".$car_type['max_seating']:""}</option>
                    {/volist}
                </select>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>



        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">出发时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text Wdate  " style="width:250px" placeholder="出发时间" name="go_date" value="{$vo.go_date ?date('Y-m-d',$vo['go_date']): ''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">结束时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text Wdate  " autocomplete="off" style="width:250px" placeholder="结束时间" name="end_date" value="{$vo.end_date ?date('Y-m-d',$vo['end_date']):''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">备注：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea  name="remark" class="textarea">{$vo.remark ?? ''}</textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <!--<table class="table table-border table-bordered table-hover table-bg mt-20">-->
            <!--<thead>-->
            <!--<tr class="text-c">-->
                <!--<th width="25"><a href="javascript:" class="label label-success radius op-add" data-type="form" onclick="add()" data-header="1">增加</a></th>-->

                <!--<th width="">订单id</th>-->
                <!--<th width="">姓名</th>-->
                <!--<th width="">电话</th>-->
                <!--<th width="">证件号码</th>-->
                <!--<th width="">地址</th>-->
                <!--<th width="70">操作</th>-->
            <!--</tr>-->
            <!--</thead>-->
            <!--<tbody id="tbody">-->
            <!--{volist name="travelers" id="traveler"}-->
            <!--<tr class="text-c">-->
                <!--<td><input type="hidden" name="traveler[id][]" value="{$traveler.id}">{$traveler.id}</td>-->
                <!--<td>{$traveler.oid}</td>-->
                <!--<td>{$traveler.name}</td>-->
                <!--<td>{$traveler.phone}</td>-->
                <!--<td>{$traveler.id_card}</td>-->
                <!--<td>{$traveler.adress}</td>-->
                <!--<td class="f-14">-->
                    <!--<a href="javascript:" class="label label-success radius op-add" data-type="form" onclick="deltd(this)" data-header="1">删除</a>-->
                <!--</td>-->
            <!--</tr>-->
            <!--{/volist}-->
            <!--</tbody>-->
        <!--</table>-->
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <div id="content"></div>
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}

<!--<script id="td" type="text/html">-->
              <!--<tr class="text-c">-->
                <!--<td><input type="hidden" name="traveler[id][]" value="<%=id%>"><%=id%></td>-->
                  <!--<td><%=oid%></td>-->
                <!--<td><%=name%></td>-->
                <!--<td><%=phone%></td>-->
                <!--<td><%=id_card%></td>-->
                <!--<td><%=adress%></td>-->
                <!--<td class="f-14">-->
                <!--<a href="javascript:" class="label label-success radius op-add" data-type="form" onclick="deltd(this)" data-header="1">删除</a>-->
                <!--</td>-->
            <!--</tr>-->
 <!--</script>-->

<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/template/template.js"></script>
<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<script>
    function add(){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }

        var index=layer.open({
            type: 2,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: '/admin/dispatch_traveler_group/traveler?'+$("input[name='traveler[id][]']").serialize()
        });
        layer.full(index);
    }
    function deltd(ele){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }
        $(ele).parent().parent().remove();
    }

    $(function () {

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //车型select2 js部分 start
        var car_type_id = $("#car_type_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['car_type_id']"}
        car_type_id.val("{$vo['car_type_id']}").trigger("change");
        {/notempty}
            //车型select2 js部分 end

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
